package com.mlnx.work.service.iml;

import com.mlnx.work.constant.GlobalConstant;
import com.mlnx.work.entity.Tag;
import com.mlnx.work.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;

@Service
public class TimeScheduleServiceIml {
    @Autowired
    private TagService tagService;

    @PostConstruct
    public void initTags() {
        GlobalConstant.TAGS = new HashMap<>();
        List<Tag> tags = tagService.list();
        for (Tag tag : tags) {
            GlobalConstant.TAGS.put(tag.getId(), tag.getTagName());
        }
    }
}
